package io.adrainty.bolee.security.models.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.adrainty.bolee.framework.commons.basic.BaseEntity;
import io.adrainty.bolee.framework.commons.basic.EnableEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;

import java.io.Serial;

/**
 * @author AdRainty
 * @version V1.0.0
 * @since 2025/8/5 上午12:29
 */

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@Schema(description = "资源实体")
public class ResourceEntity extends BaseEntity {

    @Serial
    private static final long serialVersionUID = -1135913425409849179L;

    @Schema(description = "资源编号")
    private String resourceNo;

    @Schema(description = "父资源编号")
    private String parentResourceNo;

    @Schema(description = "资源名称")
    private String resourceName;

    @Schema(description = "资源类型：s平台 c目录 m菜单 r按钮")
    private String resourceType;

    @Schema(description = "请求地址")
    private String requestPath;

    @Schema(description = "权限标识")
    private String label;

    @Schema(description = "排序")
    private Integer sortNo;

    @Schema(description = "图标")
    private String icon;

    @Schema(description = "备注")
    private String remark;

    @Schema(description = "TREE结构：选中资源编号")
    private String[] checkedResourceNos;

    @Schema(description = "角色查询资源：资源对应角色id")
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Long roleId;

    @Schema(description = "数据状态：0正常 1禁用")
    private EnableEnum dataState;

}
